import {
	NavigationActions,
} from 'react-navigation';

let _navigator;
export function setTopLevelNavigator(navigatorRef) {
	_navigator = navigatorRef;
}

export default (routeName, params = {}) => {
	_navigator.dispatch(
		NavigationActions.navigate({
			routeName,
			params,
		})
	);
}